P1 pilot: read lingcod data from data-lectures#792
Merged
Conversation
Repoints msy_fishery at the canonical copy in QuantEcon/data-lectures and drops the local one, which nothing else reads. This also fixes the lecture rather than merely relocating its data. The read was a relative path, 'datasets/lingcod_msy_recovery.csv', which only resolves inside a repo checkout — a downloaded notebook has no datasets/ directory, so the cell raised FileNotFoundError in Colab. Reading over https is what makes the notebook self-contained. Uses the interim URL form github.com/QuantEcon/data-lectures/raw/main/… and the data_url convention already used by long_run_growth and inflation_history. Blocked until the data is on data-lectures main (QuantEcon/data-lectures#10, then #11) — until then this URL 404s. The branch URL resolves today, but pointing at a non-default ref is exactly the bug meta#337 is cleaning up in mle.md, so it is not a shortcut worth taking. Verified by running the cell against the data over https: 82 rows, figure renders, terminal-year null in F/Fmsy handled. Output is unchanged — the migrated file is byte-identical (sha256 fc2f873f…) to the copy removed here. Part of QuantEcon/meta#338 See QuantEcon/meta#336 Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
✅ Deploy Preview for taupe-gaufre-c4e660 ready!
To edit notification comments on pull requests, go to your Netlify project configuration. |
This was referenced Jul 15, 2026
mmcky
marked this pull request as ready for review
July 17, 2026 00:03
There was a problem hiding this comment.
Pull request overview
This PR updates the msy_fishery lecture to load the lingcod MSY recovery dataset via HTTPS from the canonical copy in QuantEcon/data-lectures, making the notebook self-contained when run outside a repository checkout.
Changes:
- Replace the local relative-path
pd.read_csv('datasets/lingcod_msy_recovery.csv')with adata_urlpointing atQuantEcon/data-lecturesonmain. - Remove the no-longer-used local CSV from
lectures/datasets/.
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated no comments.
| File | Description |
|---|---|
| lectures/msy_fishery.md | Switches dataset loading to an HTTPS data_url hosted in QuantEcon/data-lectures. |
| lectures/datasets/lingcod_msy_recovery.csv | Deletes the local dataset copy now that the lecture reads from the canonical remote source. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
mmcky
added a commit
to QuantEcon/data-lectures
that referenced
this pull request
Jul 17, 2026
The plan gated the first repoint (Phase 8) on data integrity (Phase 7's byte-compare) but on no operational guardrail: the ordering note let a lecture go live against an unprotected main with no CI. With the P1 repoint (QuantEcon/lecture-python-intro#792) about to merge, that gap becomes real — raw/main becomes a production URL the moment it lands. - Phase 5 gains a "go-live guardrails" subset, prerequisite for Phase 8: branch protection on main (ruleset added 2026-07-17: PRs required with zero approvals so a solo maintainer can still merge, force-pushes and deletion blocked), and a minimal consumed-file CI check (every lectures/ file with a non-empty consumers list exists and matches its manifest sha256). The full automation suite keeps its own pace. - Ordering note updated to name the new gate. This is the last direct push to main; the ruleset lands immediately after. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Open
5 tasks
This was referenced Jul 17, 2026
mmcky
added a commit
to QuantEcon/data-lectures
that referenced
this pull request
Jul 17, 2026
The P1 repoint merged 2026-07-17 (QuantEcon/lecture-python-intro#792), making this the first repo state where a production lecture reads from lectures/ at build time. Record it where the rules live: - PLAN.md: tick the Phase 8 P1 item with the evidence — lecture build green in the single repoint PR, served raw/main URL verified byte-identical to the manifest sha256, Colab-unchanged holds by construction (public URL replaces the relative path that broke downloaded notebooks). The pyodide/CORS bullet stays open. Status line now says LIVE; the go-live guardrail bullet records that consumed-files became a required status check. - AGENTS.md: "freedom is now spent" updated from prospective to actual — the repo is live, published filenames are an API, and the protect-main ruleset (PRs only, no force-push, required consumed-files check) enforces it. See QuantEcon/meta#338 Co-authored-by: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
The lecture half of pilot P1 — local-path static (QuantEcon/meta#338). Repoints
msy_fisheryat the canonical copy inQuantEcon/data-lecturesand drops the local one, which nothing else reads. Paired with QuantEcon/data-lectures#12.This fixes the lecture, it doesn't just relocate the data
The read was a relative path —
pd.read_csv('datasets/lingcod_msy_recovery.csv')— which only resolves inside a repo checkout. A downloaded notebook has nodatasets/directory, so this cell raisedFileNotFoundErrorin Colab. Reading over https is what makes the notebook self-contained, which is exactly the P1 exit test.Finding: the convention has a merge-order constraint, and it needs stating
The data repo's README promises "the lecture PR builds green immediately, no two-step merge." True — but only once the data is on the data repo's default branch. Probed directly:
.../data-lectures/raw/main/lectures/lingcod_msy_recovery.csv.../data-lectures/raw/datasets/p1-lingcod/lectures/...The branch URL is right there and would turn this PR green instantly. Taking it would recreate the exact bug QuantEcon/meta#337 is cleaning up —
mle.mdhas been pinned to a non-default branch ofhigh_dim_datasince 2023, and that pin is precisely why the branch cannot be deleted today. So the order is: data PR first, lecture PR second. Each is a single step, but the order is load-bearing and belongs in QuantEcon/QuantEcon.manual#108.Verification
Ran this lecture's own cell against the data over https (branch ref substituted, since main 404s): 82 rows fetched, figure renders, no exception, and the terminal-year null in
F_over_Fmsypasses throughfill_between/plotcleanly.Output cannot move: the migrated file is byte-identical to the copy removed here (
sha256 fc2f873f...), verified before the repoint.Uses the interim URL form and the
data_urlconvention already used bylong_run_growthandinflation_history.Part of QuantEcon/meta#338
See QuantEcon/meta#336